<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    const user = {
            name: 'tom',
            age: 18
        }
        // console.log(user);

    let header = {
        get(target, name) {
            // console.log(`get:${name}`);
            // console.log(`target:${target}`);
            return '姓名:' + target[name];
        }
    }
    let proxy = new Proxy(user, header);
    console.log(proxy.name);
    let proxy3 = Object.create(proxy);
    console.log(proxy3.name);
    let header1 = {}
    let proxy1 = new Proxy(user, header1);
    console.log(proxy1.name);
</script>

</html>